import * as layoutConfig from '@/mock/layout'
export function layoutHook() {
  // 当前路由
  const route = useRoute()
  let activeId = ''
  // menu 添加id
  layoutConfig.menus.forEach((menu, index) => {
    menu.id = index.toString()
    menu.children.forEach((child, idx) => {
      child.id = `${index}-${idx}`
      if (child.href == route.path) {
        activeId = child.id
      }
    })
  })
  const layout = reactive({ ...layoutConfig })
  return { ...toRefs(layout), activeId }
}
